package com.ruoyi.system.service;


import com.ruoyi.system.domain.Order;
import com.ruoyi.system.dto.ApiByPhoneAddDto;
import com.ruoyi.system.dto.ApiOrderReceiveAddDto;
import com.ruoyi.system.dto.ApiOrderSelectDto;
import com.ruoyi.system.vo.ApiOrderVo;
import com.ruoyi.system.vo.CashCountVo;
import com.ruoyi.system.vo.OrderCountVo;
import com.ruoyi.system.vo.SumAmountVo;
import org.springframework.scheduling.annotation.Async;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


public interface OrderService extends BaseService<Order> {
    void updateOrder(Order order);

    SumAmountVo sumByUserId(Long userId);


    //释放金额
    void release(Long id);

    //释放金额
    void reject(Long id);

    //统计今日数据
    CashCountVo countByUserId(Long userId);

    OrderCountVo count(Long userId);

    //统计今日冻结数据
    BigDecimal getFreeze(Long userId);

    Object apiOrder(ApiOrderReceiveAddDto apiChinaOrderReceiveAddDto, String source);

    Object createOrderByPhone(ApiByPhoneAddDto apiChinaOrderReceiveAddDto);

    //用户确认收款
    boolean finish(Long userId, Long id);

    //用户超时补单
    boolean reduce(Long userId, Long id);

    //后台确认收款
    boolean finish(Long id);


    Order checkOrder(Long userId, Long id);


    void timeout(Long id);

    ApiOrderVo selectApiOrder(ApiOrderSelectDto apiOrderSelectDto);

    Order selectAgentOrder(Long userId, String orderNo);

    @Async
    void notice(Order orderReceive);

    //手动创建订单


    void notifyAgent(Order orderReceive);

    Order getByOrderNo(String orderNo);

    List<Long> selectUserIds(Date start, Date end);

    List<Long> selectMerchantIds(Date start, Date end);

}
